﻿
@{
    ViewBag.Title = "门诊就诊人次人数分析";
    Layout = "~/Views/Shared/_Index.cshtml";
}
<script src="@SiteUrl.GetStaticResourceScriptUrl("~/js/highcharts/highcharts.js")"></script>
<script src="@SiteUrl.GetStaticResourceScriptUrl("~/js/highcharts/modules/exporting.js")"></script>
<script>
    $(function () {
        GetOutpatientVisitNum();
        GetOutpatientVisitPerNum();
    });

    function GetOutpatientVisitNum() {
        var OutpatientList = [];
        //折线图 获取就诊人数
        $.ajax({
            url: "/HighchartsManage/Outpatient/GetOutpatientVisitNum?r=" + Math.random(),
            dataType: "json",
            async: false,
            success: function (data) {
                if (data.data) {
                    OutpatientList = data.data;
                } else {
                    for (var i = 0; i < 12; i++) {
                        OutpatientList.push([0]);
                    }
                }
            }
        });
        $('#salarychart').highcharts({
            chart: {
                zoomType: 'x'
            },
            title: {
                text: '就诊人数',
            },
            xAxis: {
                categories: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月']
            },
            yAxis: {
                min: 0,
                title: {
                    text: '单位：人'
                },
                plotLines: [{
                    value: 0,
                    width: 1,
                    color: '#808080'
                }]
            },
            tooltip: {
                valueSuffix: '人',
                headerFormat: "{point.key}:",
                pointFormat: '<tr><td>{point.y}<td></tr>',
                footerFormat: '</table>',
            },
            series: [{
                showInLegend: false,
                name: "",
                data: [
                        OutpatientList[0].num, OutpatientList[1].num, OutpatientList[2].num, OutpatientList[3].num, OutpatientList[4].num, OutpatientList[5].num, OutpatientList[6].num, OutpatientList[7].num, OutpatientList[8].num, OutpatientList[9].num, OutpatientList[10].num, OutpatientList[11].num
                ]
            }]
        });
    }

    function GetOutpatientVisitPerNum() {
        var OutpatientList = [];
        //折线图 获取就诊人次
        $.ajax({
            url: "/HighchartsManage/Outpatient/GetOutpatientVisitPerNum?r=" + Math.random(),
            dataType: "json",
            async: false,
            success: function (data) {
                if (data.data) {
                    OutpatientList = data.data;
                } else {
                    for (var i = 0; i < 12; i++) {
                        OutpatientList.push([0]);
                    }
                }
            }
        });
        $('#PerNumchart').highcharts({
            chart: {
                zoomType: 'x'
            },
            title: {
                text: '就诊人次',
            },
            xAxis: {
                categories: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月']
            },
            yAxis: {
                min: 0,
                title: {
                    text: '单位：人次'
                },
                plotLines: [{
                    value: 0,
                    width: 1,
                    color: '#808080'
                }]
            },
            tooltip: {
                valueSuffix: '人次',
                headerFormat: "{point.key}:",
                pointFormat: '<tr><td>{point.y}<td></tr>',
                footerFormat: '</table>',
            },
            series: [{
                showInLegend: false,
                name: "",
                data: [
                        OutpatientList[0].num, OutpatientList[1].num, OutpatientList[2].num, OutpatientList[3].num, OutpatientList[4].num, OutpatientList[5].num, OutpatientList[6].num, OutpatientList[7].num, OutpatientList[8].num, OutpatientList[9].num, OutpatientList[10].num, OutpatientList[11].num
                ]
            }]
        });
    }
</script>
<div class="rows" style="margin-bottom: 1%; overflow: hidden;">
    <div style="float: left; width: 49%;">
        <div style="height: 350px;border: 1px solid #e6e6e6; background-color: #fff;">
            <div class="panel panel-default">
                <div class="panel-body" style="padding-bottom: 0px;">
                    <div id="salarychart" style="height: 285px; width: 100%; padding-right: 10px;"></div>
                </div>
            </div>
        </div>
    </div>
    <div style="float: right; width: 49%;">
        <div style="height: 350px; border: 1px solid #e6e6e6; background-color: #fff;">
            <div class="panel panel-default">
                <div class="panel-body" style="padding-bottom: 0px;">
                    <div id="PerNumchart" style="height: 285px; width: 108%; padding-right: 10px;"></div>
                </div>
            </div>
        </div>
    </div>
</div>